/*
 * List
 *
 *  Created on: 04/04/2009
 *      Author: santiago
 */

#ifndef LIST_H__
#define LIST_H__
#ifndef NULL
#define NULL 0
#endif

#include "Node.h"

/**
 * List implementation in c++ using nodes to hold generic information
 */
class List {
protected:

	Node* head;
	int size;

public:

	/**
	 * Default Constructor & Destructor
	 */
	List();
	~List();
	/**
	 * Copy constructor
	 */
	List(const List& list);
	/**
	 * Operator '='
	 */
	List& operator=(const List& list);
	/**
	 * Returns the size of the list
	 */
	int getSize() const;

	/**
	 * Adds an element to the list
	 */
	void add(Node* item);

	/**
	 * Gets the item specified by the index
	 */
	Node* get(int index) const;

	/**
	 * Removes the item specified by the index
	 */
	Node* remove(int index);

	/**
	 * Returns if the list is empty
	 */
	bool empty() const;

	/**
	 * Returns the index of a node
	 */
	int getIndexOf(Node* node) const; 
};


#endif /* LIST_H__ */
